package com.shortlink.pojos.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@ApiModel
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_link")
public class LinkDO extends BaseDO{
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 全局唯一，代替id起标识作用
     */
    @ApiModelProperty("短链接标识")
    private String shortUri;

    @ApiModelProperty("原始链接")
    private String originUrl;

    /**
     * id没有标识性
     * gid取6位随机码
     */
    @ApiModelProperty("分组标识")
    private String gid;

    @ApiModelProperty("0启用1禁用")
    private String enableStatus;

    private String description;

    private String favicon;

    @ApiModelProperty("0永久有效1自定义")
    private String validDateType;

    @ApiModelProperty("有效期")
    private Date validDate;

    /**
     * page view 页面浏览量
     */
    @ApiModelProperty("历史PV")
    @TableField("total_pv")
    private Integer totalPV;

    /**
     * unique visitor 独立访客数
     */
    @ApiModelProperty("历史UV")
    @TableField("total_uv")
    private Integer totalUV;

    /**
     * unique ip 独立ip数
     */
    @ApiModelProperty("历史UIP")
    @TableField("total_uip")
    private Integer totalUIP;

}
